﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DBSourceToolsLib.Composite
{
    public class TreeNodeTag
    {
        public string DatabaseName;
        public string ObjectType;
        public string ObjectName;
        public string SysObjectKey;
        public bool IsExpanded;
        public string TargetDatabaseName;

        public TreeNodeTag(string _databaseName, string _objectType, string _objectName, string _sysObjectKey)
        {
            this.DatabaseName = _databaseName;
            this.ObjectType = _objectType;
            this.ObjectName = _objectName;
            this.SysObjectKey = _sysObjectKey;
        }

        public string GetTreeNodekey()
        {
            string strTreeNodeKey = "";
            strTreeNodeKey += DatabaseName + ".";
            strTreeNodeKey += ObjectType + ".";
            strTreeNodeKey += (String.IsNullOrEmpty(ObjectName) ? "" : ObjectName);
            return strTreeNodeKey;
        }

        public TreeNodeTag(TreeNodeTag oClone)
        {
            this.DatabaseName = oClone.DatabaseName;
            this.ObjectType = oClone.ObjectType;
            this.ObjectName = oClone.ObjectName;
            this.SysObjectKey = oClone.SysObjectKey;
        }
    }
}
